package iterator.source;

/**
 * @author cheng:
 * @Description:
 * @date: 2019/4/19 19:24
 */
public class Test {
    public static void main(String[] args) {
        ConcreteAggregate aggregate = new ConcreteAggregate();
        aggregate.set("大鸟");
        aggregate.set("小菜");
        aggregate.set("公交内部员工");
        aggregate.set("小偷");
        aggregate.set("萌妹纸");
        aggregate.set("老外");

        Iterator iterator = aggregate.createIterator();
        Object first = iterator.first();
        System.out.println(first);
        while (!iterator.idDone()){
            Object next = iterator.next();
            System.out.println(next);
        }
    }
}
